﻿

Imports System.Collections.Generic

Public Class FrmSelectSingleProject

  Private projects As New ProjectHolderCollection

  Sub InitWithProjects(projects As ProjectHolderCollection, questionTitle As String)

    Me.lblTitle.Text = questionTitle

    Me.projects = projects
    For Each ph In projects

      cmbProjects.Items.Add(ph.FullName)

    Next

    If cmbProjects.Items.Count > 0 Then cmbProjects.SelectedIndex = 0

  End Sub

  Public ReadOnly Property SelectedProject As ProjectHolder
    Get
      If cmbProjects.SelectedIndex < 0 Then
        Return Nothing
      Else
        Dim tp = projects.Item(cmbProjects.SelectedIndex)
        Return tp
      End If
    End Get
  End Property

End Class